<?php
	$groupid = checkUserGroup($_SESSION['username']);
	echo "<h2>Group Menu</h2>";
	
	if ($groupid == NULL || $groupid == 0) {
		echo "<p><a href=\"?creategroup\">Create a new Flatshare Group</a></p>";
	}
	else {
		echo "<p><a href=\"?viewbills\">View your current responsibilities</a></p>";
		echo "<p><a href=\"?addbill\">Add a new responsibility</a></p>";
		echo "<p><a href=\"?viewnotifications\">View your notifications</a></p>";
		echo "<p><a href=\"?trackbills\">Track your entries</a></p>";
		echo "<p><a href=\"?leavegroup\">Leave your current Flatshare Group</a></p>";
		echo "<br />";
		if (checkGroupAdmin($groupid, $_SESSION['username'])) {
			echo "<h2>Admin Functions</h2>";
			echo "<p><a href=\"?adduser\">Add a user to the Flatshare Group</a></p>";
			echo "<p><a href=\"?removeuser\">Remove a user from the Flatshare Group</a></p>";
			echo "<p><a href=\"?makeadmin\">Make a user an Admin of the Flatshare Group</a></p>";
		}
	}
?>